package observer;

/**
 * Created by lenovo on 2017/11/6.
 */
public class CurrentConditionDisplay implements Observer,DisplayElement {

    private float temperature;
    private float humidity;
    private float pressure;
    private  Subject weatherData;

    public CurrentConditionDisplay(Subject weatherData){
        this.weatherData=weatherData;
        weatherData.registerObserver(this);
    }
    @Override
    public void update(float temp, float humidity, float pressure) {
        this.temperature=temp;
        this.humidity=humidity;
        this.pressure=pressure;
        dispaly();

    }

    @Override
    public void dispaly() {
        System.out.println("current condition:"+temperature+" f depress and "+humidity+"");

    }
}
